﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication2
{
    public partial class Regist : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            string name = TextBox1.Text;
            string password = TextBox2.Text;
            int gener = RadioButton1.Checked ? 0 : 1;
            string email = TextBox3.Text;

            string sql = "INSERT INTO StudentInfo(Stu_name,gender,email,password) values (@name,@gender,@email,@password)";
             SqlParameter[] pars =
                {
                new SqlParameter("@name",name),
                new SqlParameter("@gener",gener),
                new SqlParameter("@email",email),
                new SqlParameter("@password",password),
                };
            SQLHelper helper = new SQLHelper();
            int result = helper.Rent(sql,pars);
          
                Literal1.Text="注册成功！<a href=\"Loign.aspx\">去登录</a>";
            
        }
    }
}